package com.luo.service.movie.impl;

import com.luo.dao.MovieDao;
import com.luo.pojo.Movie;
import com.luo.service.movie.MovieService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Luo
 */
@Service("MovieService")
public class MovieServiceImpl implements MovieService {
    @Autowired
    private MovieDao movieDao;

    @Override
    public List<Movie> queryWatchedMovies() {
        return this.movieDao.queryWatchedMovies();
    }

    @Override
    public List<Movie> queryWantToWatch() {
        return this.movieDao.queryWantToWatch();
    }

    @Override
    public List<Movie> queryWatching() {
        return this.movieDao.queryWatching();
    }

    @Override
    public int insertMovie(String name, String link, String img, int status, String meta, String content) {
        return this.movieDao.insertMovie(name,link,img,status,meta,content);
    }

    @Override
    public List<Movie> selectAllMovie() {
        return this.movieDao.selectAllMovie();
    }

    @Override
    public int deleteMovieById(int mid) {
        return this.movieDao.deleteMovieById(mid);
    }

    @Override
    public List<Movie> getMoviesByName(String name) {
        return this.movieDao.getMoviesByName(name);
    }

    @Override
    public int updateMovie(Movie movie) {
        return this.movieDao.updateMovie(movie);
    }
}
